<?php

namespace App\Module\Sub;

use App\depository\ManageMapExtraDep;
use App\depository\SteamIDEosidDep;
use App\depository\SubAuthorityDep;
use App\Enum\MapEnum;
use App\Module\BaseModule;
use App\depository\ManageMapDep;
use App\Service\DictService;

class SubSteamModule extends BaseModule
{
    public function init($request)
    {
        $dictService = new DictService();

        $teamId = $request->headers->get('TeamId');
        $dictService->setAuthorityGroup( $teamId);

        $data['dict'] = $dictService->getDict();

        return self::response($data);
    }

    public function detail($request)
    {
        $param = $request->input();

        $dep = new SteamIDEosidDep();

        $res = $dep->firstBySteamid($param['steamid']);

        $data['detail'] = [
          'id' => $res->id,
          'steamid' => $res->steamid,
          'eosid' => $res->eosid,
          'tag' => $res->tag,
            'tag_permission' => $res->tag_permission,
        ];

        return self::response($data);
    }

    public function edit($request){

        $param = $request->input();

        $data = [
          'tag' => $param['tag'],
          'tag_permission' => $param['tag_permission']
        ];

        $dep = new SteamIDEosidDep();



    }


}

